#!/usr/bin/env python
# encoding: utf-8
"""
@author: youfeng
@email: youfeng243@163.com
@license: Apache Licence 
@file: parse_anhui.py
@time: 2016/12/22 15:07
"""
import json

from parse.base_object import ParseObject


class prase_object_sichuan(ParseObject):
    def __init__(self, **kwargs):
        ParseObject.__init__(self, **kwargs)

    def get_base_info(self, url, item=None):

        param = None
        try:
            param = item.get('base_info_post_param', None)
            if param is None:
                return None
            param = param.replace('.', '_')
            base_info = json.loads(param)
        except Exception as e:
            self.log.exception(e)
            self.log.error('param = {param}'.format(param=param))
            return None

        return base_info
